<template>
	<view class="container">
		<view class="container-c" v-if="list.length>0">
			<view class="item-top gray" @tap="goList(list[0].id)">
				<text>{{list[0].name}}</text>
				<image :src="`${list[0].icon}`" mode=""></image>
			</view>
			<view class="item-top white"  @tap="goList(list[1].id)">
				<text>{{list[1].name}}</text>
				<image :src="`${list[1].icon}`" mode=""></image>
			</view>
			<view class="bottom">
				<view class="item-bottom"  @tap="goList(list[2].id)">
					<text>{{list[2].name}}</text>
					<image class="gray" :src="`${list[2].icon}`" mode=""></image>
				</view>
				<view class="item-bottom"  @tap="goList(list[3].id)">
					<text>{{list[3].name}}</text>
					<image class="white" :src="`${list[3].icon}`" mode=""></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		findCategory
	} from "@/api/kind/index.js"
	export default {
		data() {
			return {
				list: []
				
				
			};
		},
		onLoad() {

			findCategory().then(res => {
				console.log(res)
				this.list = res.data.category.children;
				console.log(this.list)
			})
		},
		methods:{
			goList(id){
				uni.navigateTo({
					url:"/pages/list/list?id="+id
				})
			}
		}
		
	}
</script>

<style lang="scss">
	.container {
		width: 100%;
		background-color: #f1ece7;
		height: 100vh;
		overflow: hidden;
	}

	.container-c {
		width: 670rpx;
		margin: 0 auto;
	}

	.item-top {
		display: flex;
		align-items: center;
		justify-content: space-between;
		border-radius: 40rpx;
		margin-top: 60rpx;

		image {
			width: 402rpx;
			height: 302rpx;
		}

		text {
			font-size: 48rpx;
			color: #3e3e3e;
			margin: 40rpx 0 0 40rpx;
		}
	}

	.bottom {
		display: flex;
		margin-top: 60rpx;
		justify-content: space-between;
	}

	.item-bottom {
		width: 312rpx;
		height: 442rpx;
		position: relative;
		image {
			width: 312rpx;
			height: 442rpx;
		}
		text{
			position: absolute;
			left: 40rpx;
			top: 150rpx;
			z-index: 99;
			font-size: 48rpx;
			color: #3e3e3e;
		}
	}

	.gray {
		background-color: #d5d5d5;
		// border-radius: 40rpx;
	}

	.white {
		background-color: #fff;
		border-radius: 20rpx;
	}
</style>
